import { http } from '@/utils/http'

/** 查询岗位列表 */
export const listPost = (params?: object) => {
  return http.request<HttpPaginationResponse<Array<any>>>('get', '/system/post/list', {
    params,
  })
}

/** 查询岗位详细 */
export const getPost = (postId: number) => {
  return http.request<HttpResponse<Object>>('get', `/system/post/` + postId)
}

/** 新增岗位 */
export const addPost = (data?: object) => {
  return http.request<HttpResponse<Object>>('post', '/system/post', {
    data,
  })
}

/** 修改岗位 */
export const updatePost = (data?: object) => {
  return http.request<HttpResponse<Object>>('put', '/system/post', {
    data,
  })
}

/** 删除岗位 */
export const delPost = (postId?: string) => {
  return http.request<HttpResponse<Object>>('delete', `/system/post/` + postId)
}
